package com.example.hangzhou.welbeing.mytestdemoapp.factory;

import android.support.v4.app.Fragment;

import com.example.hangzhou.welbeing.mytestdemoapp.fragment.ArcMotionFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.AutoTransitionFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.ChangeBoundsFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.ChangeClipBoundsFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.ChangeImageTransformFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.ChangeScrollFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.ChangeTransformFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.ExplodeFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.FadeFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.SlideFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.ToggleFragment;
import com.example.hangzhou.welbeing.mytestdemoapp.fragment.TransitionSetFragment;

import java.util.HashMap;

/**
 * 杭州惟君医疗科技有限公司10
 * Created by 20433 on 2018/5/9
 *
 * @desc 东风山河绿，春已不折柳，繁花看不尽，处处惹人留
 * @desc 佛祖镇楼，bug辟容易
 */

public class TransitionNoteFragmentFactory {
    // "toggle","autoTransition","changeBounds","changeClipBounds","changeImageTransform",
    // "changeScroll","changeTransform","explode","fade","slide","transitionSet","ArcMotion"
    private static final int TOGGLE = 0;
    private static final int AUTO_TRANSITION = 1;
    private static final int CHANGE_BOUNDS = 2;
    private static final int CHANGE_CLIP_BOUNDS = 3;
    private static final int CHANGE_IMAGE_TRANSFORM = 4;
    private static final int CHANGE_SCROLL = 5;
    private static final int CHANGE_TRANSFORM = 6;
    private static final int EXPLODE = 7;
    private static final int FADE = 8;
    private static final int SLIDE = 9;
    private static final int TRANSITION_SET = 10;
    private static final int ARC_MOTION = 11;
    private static HashMap<Integer, Fragment> mapAll = new HashMap();
    public static Fragment CreateCircleObject(int position) {
        Fragment fragment = mapAll.get(position);
        if (fragment == null) {
            switch (position) {
                case TOGGLE:
                    fragment = new ToggleFragment();
                    break;
                case AUTO_TRANSITION:
                    fragment = new AutoTransitionFragment();
                    break;
                case CHANGE_BOUNDS:
                    fragment = new ChangeBoundsFragment();
                    break;
                case CHANGE_CLIP_BOUNDS:
                    fragment = new ChangeClipBoundsFragment();
                    break;
                case CHANGE_IMAGE_TRANSFORM:
                    fragment = new ChangeImageTransformFragment();
                    break;
                case CHANGE_SCROLL:
                    fragment = new ChangeScrollFragment();
                    break;
                case CHANGE_TRANSFORM:
                    fragment = new ChangeTransformFragment();
                    break;
                case EXPLODE:
                    fragment = new ExplodeFragment();
                    break;
                case FADE:
                    fragment = new FadeFragment();
                    break;
                case SLIDE:
                    fragment = new SlideFragment();
                    break;
                case TRANSITION_SET:
                    fragment = new TransitionSetFragment();
                    break;
                case ARC_MOTION:
                    fragment = new ArcMotionFragment();
                    break;

            }
            mapAll.put(position, fragment);
            return fragment;
        }
        return fragment;
    }
}
